package ce.com.newbluedemo.my;

import android.app.Application;

import ce.com.cenewbluesdk.proxy.BleFactory;

/**
 * Created by Administrator on 2016/11/15 0015.
 */
public class MyApp extends Application {

    private K1_Handler mk1h;
    private static MyApp myApp;

    @Override
    public void onCreate() {
        super.onCreate();
        BleFactory.init(this);
        mk1h=new K1_Handler();
        myApp=this;
        BleFactory.getInstance().getK1Proxy().setHandler(mk1h);
        BleFactory.getInstance().getK3Proxy().setHandler(mk1h);
        BleFactory.getInstance().getK2Proxy().setHandler(mk1h);
        BleFactory.getInstance().getK6Proxy().setHandler(mk1h);
    }
    public static MyApp getInstance(){
        return myApp;
    }
    public void addBlueListen(K1_Handler.ReceiveBlueDataListen listen){
        mk1h.addReceiveBlueDataListen(listen);
    }
    public void romeveBlueListen(K1_Handler.ReceiveBlueDataListen listen){
        mk1h.removeReceiveBlueDataListen(listen);
    }
}
